package com.cacho.s2b.lesson.design;

/**
 * @Description 单例模式：2.饿汉式（静态代码块）【可用】
 * @Author LingWei
 * @date 2023/12/14
 **/
public class Singleton2 {
    private final static Singleton2 instance;

    static {instance = new Singleton2();}
    private Singleton2(){}

    public static Singleton2 getInstance(){
        return instance;
    }
}